{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import time\n",
    "import sys\n",
    "\n",
    "import numpy as np\n",
    "\n",
    "from pyne import nucname\n",
    "from pyne.material import Material\n",
    "from pyne.transmute.chainsolve import Transmuter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "nucid = nucname.id('FE56')\n",
    "inp = Material({nucid : 1.0}, mass=1.0)\n",
    "t_sim = 31536000.0\n",
    "tol = 1e-7\n",
    "phi = np.array([  # fluxin1 from ALARA\n",
    "    0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00, 0.00000E+00,\n",
    "    0.00000E+00, 8.98755E+13, 9.77446E+12, 8.06925E+12, 1.70726E+12, 1.28302E+12,\n",
    "    1.89143E+12, 2.04175E+12, 2.07250E+12, 1.80384E+12, 1.54256E+12, 1.42579E+12,\n",
    "    1.24872E+12, 1.17419E+12, 1.14707E+12, 1.19572E+12, 1.22437E+12, 1.26141E+12,\n",
    "    4.38938E+11, 9.07635E+11, 1.39910E+12, 1.45818E+12, 1.48523E+12, 1.43566E+12,\n",
    "    1.41561E+12, 1.40784E+12, 1.35321E+12, 2.71459E+12, 2.62508E+12, 2.66233E+12,\n",
    "    1.40292E+12, 1.42487E+12, 1.37130E+12, 1.37665E+12, 1.52025E+12, 1.59680E+12,\n",
    "    1.07723E+12, 2.77969E+11, 2.78790E+11, 5.53898E+11, 1.09314E+12, 1.64561E+12,\n",
    "    1.68331E+12, 1.74677E+12, 1.80254E+12, 1.93480E+12, 1.96231E+12, 1.93938E+12,\n",
    "    1.92934E+12, 1.93774E+12, 1.90789E+12, 1.82967E+12, 1.88061E+12, 1.89368E+12,\n",
    "    1.81907E+12, 3.42703E+12, 1.43106E+12, 2.05052E+12, 1.78729E+12, 1.86431E+12,\n",
    "    1.83209E+12, 1.87158E+12, 1.80219E+12, 1.73173E+12, 1.60686E+12, 1.29878E+12,\n",
    "    1.48781E+12, 1.61671E+12, 1.60349E+12, 1.59722E+12, 3.03722E+12, 2.90241E+12,\n",
    "    1.42928E+12, 1.35835E+12, 2.69252E+12, 2.55807E+12, 2.86956E+11, 1.05539E+11,\n",
    "    2.25492E+11, 5.88210E+11, 1.19440E+12, 2.20287E+12, 1.08398E+12, 1.03200E+12,\n",
    "    9.75760E+11, 9.46015E+11, 9.12835E+11, 9.29522E+11, 8.90411E+11, 8.30228E+11,\n",
    "    8.45313E+11, 8.07049E+11, 7.71896E+11, 7.07755E+11, 8.21782E+11, 7.22692E+11,\n",
    "    7.33346E+11, 6.91441E+11, 1.63354E+12, 1.56807E+12, 5.29641E+11, 4.48653E+11,\n",
    "    1.07702E+12, 8.07461E+11, 1.82087E+12, 7.58110E+11, 1.26259E+12, 1.12779E+12,\n",
    "    1.54243E+12, 6.74366E+11, 8.42541E+11, 4.34202E+11, 2.89471E+11, 3.71251E+11,\n",
    "    2.64038E+11, 2.30016E+11, 5.82748E+11, 9.47843E+11, 1.71492E+12, 1.80379E+12,\n",
    "    5.48701E+11, 8.73235E+11, 1.82674E+12, 1.52497E+12, 1.48336E+12, 9.67624E+11,\n",
    "    6.31697E+11, 6.03210E+11, 5.84716E+11, 1.49733E+11, 1.84075E+11, 7.72799E+11,\n",
    "    1.82977E+11, 1.80083E+12, 1.48029E+12, 1.45254E+12, 1.44214E+12, 1.34832E+12,\n",
    "    1.10171E+12, 1.27549E+12, 1.33060E+12, 1.27163E+12, 1.32883E+12, 1.32596E+12,\n",
    "    1.35429E+12, 1.34940E+12, 1.34862E+12, 1.34699E+12, 1.32883E+12, 1.33697E+12,\n",
    "    1.33352E+12, 1.32882E+12, 1.32283E+12, 1.31655E+12, 1.30955E+12, 1.30178E+12,\n",
    "    1.29327E+12, 1.28377E+12, 1.27355E+12, 1.26193E+12, 1.24944E+12, 1.23535E+12,\n",
    "    1.21970E+12, 1.20272E+12, 1.18312E+12, 1.16152E+12, 1.13736E+12, 2.82140E+12,\n",
    "    5.36871E+13])\n",
    "tm = Transmuter(phi=phi, tol=tol, log=sys.stdout)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "--> Fe56 1.0\n",
      "   |--> Fe57 [0.00438046]\n",
      "   |--> Fe57 1.0\n",
      "   |   |--> Fe58 [9.18336666e-06]\n",
      "   |   |--> Fe58 1.0\n",
      "   |   |   |--> Fe59 [2.42666743e-09]\n",
      "   |   |   |--> Cr56 [8.48355844e-23]\n",
      "   |   |   |--> Cr55 [5.18805e-15]\n",
      "   |   |   |--> Mn57 [3.32510519e-17]\n",
      "   |   |   |--> Mn58 [5.50579059e-17]\n",
      "   |   |   |--> Mn56 [8.01386265e-19]\n",
      "   |   |   |--> Fe57 [9.32443551e-09]\n",
      "   |   |   |--> Mn58M [5.39244677e-16]\n",
      "   |   |   |--> Cr54 [5.1899113e-12]\n",
      "   |   |--> Cr55 [1.19819151e-17]\n",
      "   |   |--> Cr54 [2.35240098e-07]\n",
      "   |   |--> Cr54 1.0\n",
      "   |   |   |--> Cr55 [1.40945438e-15]\n",
      "   |   |   |--> Ti51 [1.79352912e-16]\n",
      "   |   |   |--> V53 [5.32034599e-18]\n",
      "   |   |   |--> V54 [2.55387164e-17]\n",
      "   |   |   |--> V52 [6.44852455e-20]\n",
      "   |   |   |--> Cr53 [2.81950119e-10]\n",
      "   |   |   |--> Ti50 [2.69566822e-13]\n",
      "   |   |--> Mn56 [6.72436461e-11]\n",
      "   |   |--> Cr56 [1.66874942e-20]\n",
      "   |   |--> Mn57 [5.29448233e-12]\n",
      "   |   |--> Mn55 [7.74655993e-10]\n",
      "   |   |--> Fe56 [8.55972423e-06]\n",
      "   |   |--> Fe56 1.0\n",
      "   |   |   |--> Fe57 [1.25875636e-08]\n",
      "   |   |   |--> Cr53 [3.71225677e-10]\n",
      "   |   |   |--> Mn55 [4.94094467e-10]\n",
      "   |   |   |--> Mn56 [1.59905049e-12]\n",
      "   |   |   |--> Mn54 [3.38062974e-14]\n",
      "   |   |   |--> Fe55 [3.24252005e-09]\n",
      "   |   |   |--> Cr52 [3.8749132e-12]\n",
      "   |   |--> Cr53 [1.21595729e-08]\n",
      "   |--> Cr53 [0.00012834]\n",
      "   |--> Cr53 1.0\n",
      "   |   |--> Cr54 [1.97194095e-06]\n",
      "   |   |--> Cr54 1.0\n",
      "   |   |   |--> Cr55 [1.18149969e-14]\n",
      "   |   |   |--> Ti51 [1.50345712e-15]\n",
      "   |   |   |--> V53 [4.45987252e-17]\n",
      "   |   |   |--> V54 [2.14082727e-16]\n",
      "   |   |   |--> V52 [5.4055881e-19]\n",
      "   |   |   |--> Cr53 [2.36865302e-09]\n",
      "   |   |   |--> Ti50 [2.26464551e-12]\n",
      "   |   |--> Ti51 [6.02570968e-19]\n",
      "   |   |--> Ti50 [5.78481821e-09]\n",
      "   |   |--> V52 [4.26296948e-14]\n",
      "   |   |--> Ti52 [1.28370431e-23]\n",
      "   |   |--> V53 [8.76560312e-14]\n",
      "   |   |--> V51 [1.50342873e-09]\n",
      "   |   |--> Cr52 [2.61458516e-07]\n",
      "   |   |--> Cr52 1.0\n",
      "   |   |   |--> Cr53 [1.15404141e-10]\n",
      "   |   |   |--> Ti50 [2.67941074e-17]\n",
      "   |   |   |--> Ti49 [1.02577389e-11]\n",
      "   |   |   |--> V51 [1.96007372e-11]\n",
      "   |   |   |--> Ti51 [5.52374408e-24]\n",
      "   |   |   |--> V52 [8.27277081e-16]\n",
      "   |   |   |--> Cr51 [1.9107767e-11]\n",
      "   |   |   |--> Ti48 [3.45464382e-15]\n",
      "   |   |--> Ti49 [1.9506614e-11]\n",
      "   |--> Mn55 [0.00017116]\n",
      "   |--> Mn55 1.0\n",
      "   |   |--> Mn56 [1.74489151e-09]\n",
      "   |   |--> V53 [1.75536085e-17]\n",
      "   |   |--> V52 [1.79426349e-13]\n",
      "   |   |--> Cr54 [1.20633097e-08]\n",
      "   |   |--> Cr55 [2.39406026e-13]\n",
      "   |   |--> Cr53 [2.41876795e-10]\n",
      "   |   |--> Mn54 [1.68402998e-07]\n",
      "   |   |--> Mn54 1.0\n",
      "   |   |   |--> Cr54 [4.8578912e-08]\n",
      "   |   |   |--> Fe54 [4.51124237e-14]\n",
      "   |   |   |--> Mn55 [1.08034011e-09]\n",
      "   |   |   |--> V52 [1.47783986e-21]\n",
      "   |   |   |--> V51 [6.93624479e-12]\n",
      "   |   |   |--> Cr53 [1.28699437e-11]\n",
      "   |   |   |--> V53 [3.45352593e-25]\n",
      "   |   |   |--> Cr52 [4.39811579e-15]\n",
      "   |   |   |--> Mn53 [1.61121451e-10]\n",
      "   |   |   |--> V50 [4.80653963e-13]\n",
      "   |   |--> V51 [3.06438194e-10]\n",
      "   |--> Mn56 [1.85782312e-07]\n",
      "   |--> Mn56 1.0\n",
      "   |   |--> Fe56 [0.00043724]\n",
      "   |   |--> Fe56 1.0\n",
      "   |   |   |--> Fe57 [9.63708652e-07]\n",
      "   |   |   |--> Fe57 1.0\n",
      "   |   |   |   |--> Fe58 [1.34596443e-09]\n",
      "   |   |   |   |--> Cr55 [2.63601348e-21]\n",
      "   |   |   |   |--> Cr54 [3.44753726e-11]\n",
      "   |   |   |   |--> Mn56 [1.47874121e-14]\n",
      "   |   |   |   |--> Cr56 [3.67121315e-24]\n",
      "   |   |   |   |--> Mn57 [1.16478929e-15]\n",
      "   |   |   |   |--> Mn55 [1.13742807e-13]\n",
      "   |   |   |   |--> Fe56 [1.2546733e-09]\n",
      "   |   |   |   |--> Cr53 [1.78657394e-12]\n",
      "   |   |   |--> Cr53 [2.83591353e-08]\n",
      "   |   |   |--> Mn55 [3.77703949e-08]\n",
      "   |   |   |--> Mn56 [8.17149537e-11]\n",
      "   |   |   |--> Mn54 [2.4314454e-12]\n",
      "   |   |   |--> Fe55 [2.43136515e-07]\n",
      "   |   |   |--> Fe55 1.0\n",
      "   |   |   |   |--> Mn55 [2.08496906e-08]\n",
      "   |   |   |   |--> Fe56 [9.31024176e-10]\n",
      "   |   |   |   |--> Cr53 [2.26986158e-16]\n",
      "   |   |   |   |--> Cr52 [1.94843187e-11]\n",
      "   |   |   |   |--> Mn54 [1.71099481e-12]\n",
      "   |   |   |   |--> Cr54 [2.55199144e-12]\n",
      "   |   |   |   |--> Mn53 [2.95532308e-13]\n",
      "   |   |   |   |--> Fe54 [9.30827174e-11]\n",
      "   |   |   |   |--> Cr51 [2.08480107e-14]\n",
      "   |   |   |--> Cr52 [2.9680663e-10]\n",
      "   |--> Mn54 [9.7308571e-09]\n",
      "   |--> Fe55 [0.00105972]\n",
      "   |--> Fe55 1.0\n",
      "   |   |--> Mn55 [0.00013905]\n",
      "   |   |--> Mn55 1.0\n",
      "   |   |   |--> Mn56 [1.41705352e-09]\n",
      "   |   |   |--> V53 [1.42610748e-17]\n",
      "   |   |   |--> V52 [1.45770504e-13]\n",
      "   |   |   |--> Cr54 [6.660657e-09]\n",
      "   |   |   |--> Cr55 [1.94499632e-13]\n",
      "   |   |   |--> Cr53 [1.33878231e-10]\n",
      "   |   |   |--> Mn54 [9.88058199e-08]\n",
      "   |   |   |--> V51 [1.69294963e-10]\n",
      "   |   |--> Fe56 [6.22048126e-06]\n",
      "   |   |--> Fe56 1.0\n",
      "   |   |   |--> Fe57 [9.34023045e-09]\n",
      "   |   |   |--> Cr53 [2.75434266e-10]\n",
      "   |   |   |--> Mn55 [3.66607049e-10]\n",
      "   |   |   |--> Mn56 [1.16209472e-12]\n",
      "   |   |   |--> Mn54 [2.5024454e-14]\n",
      "   |   |   |--> Fe55 [2.40410966e-09]\n",
      "   |   |   |--> Cr52 [2.87531711e-12]\n",
      "   |   |--> Cr53 [1.51280374e-12]\n",
      "   |   |--> Cr52 [1.30221707e-07]\n",
      "   |   |--> Cr52 1.0\n",
      "   |   |   |--> Cr53 [5.85551932e-11]\n",
      "   |   |   |--> Ti50 [1.35963708e-17]\n",
      "   |   |   |--> Ti49 [5.20510264e-12]\n",
      "   |   |   |--> V51 [9.94592049e-12]\n",
      "   |   |   |--> Ti51 [2.75115238e-24]\n",
      "   |   |   |--> V52 [4.12032917e-16]\n",
      "   |   |   |--> Cr51 [9.57762086e-12]\n",
      "   |   |   |--> Ti48 [1.75295891e-15]\n",
      "   |   |--> Mn54 [1.07022387e-08]\n",
      "   |   |--> Cr54 [1.70537115e-08]\n",
      "   |   |--> Mn53 [1.95492583e-09]\n",
      "   |   |--> Fe54 [6.2181064e-07]\n",
      "   |   |--> Fe54 1.0\n",
      "   |   |   |--> Fe55 [7.66412987e-10]\n",
      "   |   |   |--> Cr52 [1.96993819e-15]\n",
      "   |   |   |--> Mn52M [7.15530513e-18]\n",
      "   |   |   |--> Cr51 [1.75120966e-11]\n",
      "   |   |   |--> Mn53 [4.64570346e-10]\n",
      "   |   |   |--> Cr53 [1.97548348e-12]\n",
      "   |   |   |--> Mn54 [3.23542868e-10]\n",
      "   |   |   |--> Mn52 [3.11634445e-16]\n",
      "   |   |   |--> Fe53 [1.68786921e-16]\n",
      "   |   |   |--> Cr50 [1.79244516e-13]\n",
      "   |   |--> Cr51 [1.01013449e-10]\n",
      "   |--> Cr52 [1.35040579e-06]\n",
      "   |--> Cr52 1.0\n",
      "   |   |--> Cr53 [8.89591993e-10]\n",
      "   |   |--> Ti50 [2.07097938e-16]\n",
      "   |   |--> Ti49 [7.92519715e-11]\n",
      "   |   |--> V51 [1.5138451e-10]\n",
      "   |   |--> Ti51 [2.8530005e-23]\n",
      "   |   |--> V52 [4.27284275e-15]\n",
      "   |   |--> Cr51 [1.09072537e-10]\n",
      "   |   |--> Ti48 [2.66741826e-14]\n",
      "Transmutation time: 3.492919921875\n"
     ]
    }
   ],
   "source": [
    "t1 = time.time()\n",
    "out = tm.transmute(inp, t=t_sim)\n",
    "dt = time.time() - t1\n",
    "print('Transmutation time: {0}'.format(dt))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
